package zuoye02;

public class Student extends Person{
  private String no;
   private double scoreEn;
   private double scoreMath;
   private double scoreCh;


    public Student(String name,String sex , int age, String no,double scoreCh , double scoreEn , double scoreMath){
         super(name, sex, age);
        this.no=no;
        this.scoreMath=scoreMath;
        this.scoreCh= scoreCh;
        this.scoreEn= scoreEn;

    }
    public double aver(){

        return (scoreCh + scoreEn + scoreMath)/3;
    }
    public double max(){
        return Math.max(Math.max(scoreCh,scoreEn),scoreMath);
     }

    public double min(){
        return Math.min(Math.min(scoreCh,scoreEn),scoreMath);
    }

    @Override
    public String toString() {
        return "Student{" +
                "no='" + no + '\'' +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}
